package org.emaait.app.aop.exception;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.emaait.app.service.Loggable;

@Aspect
public class AfterThrowAdvice implements Loggable{
	@Pointcut("execution(* org.emaait.app.action..*.*(..))")
	public void actionThrow(){}
	
	@AfterThrowing(
			pointcut="actionThrow()"
			,throwing="ex")
	public void processException(JoinPoint jp, Throwable ex){
		log.info("exec afterthrowadvice");
		log.error(ex.getMessage());
	}
}
